﻿using ChineseSchool.BLL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ChineseSchool.UserControl.ThuNghiem
{
    public partial class ucUserComment : System.Web.UI.UserControl
    {
        private B_User userService = new B_User();
        private B_Insert_Update_Delete insertUpdate = new B_Insert_Update_Delete();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                LoadUserInfo();
            }
        }

        private void LoadUserInfo()
        {
            string userName = Session["Username"].ToString();
            string userPassword = Session["PassWord"].ToString();
            var currentUser = userService.Selectby_username_password(userName, userPassword);

            if (currentUser != null)
            {
                txtUserName.Text = currentUser.UserName;
                txtEmail.Text = currentUser.Email;
            }
        }


        [System.Web.Services.WebMethod]
        public static void PostComment(string name)
        {
             var xxx = "Hello " + name + Environment.NewLine + "The Current Time is: "
                + DateTime.Now.ToString();
        }

    }
}